#ifndef USERONLINEMANAGER_H
#define USERONLINEMANAGER_H

#include "Entity/UserOnline.h"
#include "api/systemMonitor/useronlineapi.h"
#include <QObject>
#include <Utils.h>
#include <ui_index.h>

class UserOnlineManager : public QObject
{
    Q_OBJECT
public:
    explicit UserOnlineManager(Ui::Index *ui,QObject *parent = nullptr);
private slots:
    void pageSizeChanged(int index);

private:
    Ui::Index *ui;
    Utils utils;
    int pageSize = 10;
    int total;
    int totalPage;
    int currentPage = 1;
    QList<UserOnline> userList;
    UserOnlineApi api;

    void init();
    void initSearchArea();
    void getList();
    void initTable();
    void initPageInfo();
};

#endif // USERONLINEMANAGER_H
